import { createApp } from "vue";
import { createPinia } from "pinia";
import router from "./router";

import App from "./App.vue";
const app = createApp(App);

// 关闭开发环境下的警告
app.config.warnHandler = () => null;

import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import '@/assets/iconfontFlow/iconfont.css';
import '@/assets/iconfont/iconfont.css';
import '@/assets/font/iconfont.css';
// 引入Element Plus暗黑模式样式
import 'element-plus/theme-chalk/dark/css-vars.css'
// 导入全局样式
import './styles/index.scss'
// 引入Element Plus图标
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
// 导入rem设置
import '@/utils/rem';

// 注册Element Plus图标组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// 注册全局组件
import SvgIcon from "@/components/SvgIcon/index.vue";
// 导入SVG图标
import "virtual:svg-icons-register";

app.component("SvgIcon", SvgIcon);
app.use(createPinia());
app.use(router);
app.use(ElementPlus, {
  locale: zhCn,
});
app.mount("#app");

// 修改 el-dialog 点击空白隐藏的默认值为false 
app._context.components.ElDialog.props.closeOnClickModal.default = false;
